package com.wwl.cms.utils.designModeTest.iterator;

import java.util.Iterator;
import java.util.List;

/**
 * @author wwl
 * @version 1.0
 * @date 2021/9/9 19:36
 * @description:
 */
public class OutPutImpl {
    //学院集合
    List<College> collegeList;

    public OutPutImpl (List<College> collegeList){
        this.collegeList = collegeList;
    }

    public void printCollege(){
        Iterator<College> iterator = collegeList.iterator();
        while (iterator.hasNext()){
            College college = iterator.next();
            System.out.println("======="+college.getName()+"========");
            //printDepartment(college.createIterable());
        }
    }

    public void printDepartment(Iterator iterator){
        while (iterator.hasNext()){
            Department d=(Department) iterator.next();
            System.out.println(d.getName());
        }
    }

}
